<?php
/**
 * Created by PhpStorm.
 * User: LiuJiaJun
 * Date: 2018/2/22
 * Time: 9:59
 */
return array(
    //App模块使用的日志
    'DefaultSocketServiceLogFactory' => array(
        'appenders' => array(
            'default' => array(
                'class' => 'LoggerAppenderDailyFile',
                'layout' => array(
                    'class' => 'LoggerLayoutPattern',
                    'params' => array(
                        'conversionPattern' => '%date{Y-m-d H:i:s.u} %logger %level %class(%line) %ex %message%newline'
                    )
                ),
                'filters' => [
                    [
                        'class' => 'LoggerFilterLevelRange',
                        'params' => [
                            'levelMin' => 'info',
                            'levelMax' => 'info',
                            'acceptOnMatch' => true,
                        ]
                    ]
                ],
                'params' => array(
                    'threshold' => 'info',
                    'file' => 'logs/info/' . date('Y-m') . '/' . date('Y-m-d') . '/info_%s.log',
                    'datePattern' => 'Y-m-d.H'
                )
            ),
            'debug' => array(
                'class' => 'LoggerAppenderDailyFile',
                'layout' => array(
                    'class' => 'LoggerLayoutPattern',
                    'params' => array(
                        'conversionPattern' => '%date{Y-m-d H:i:s.u} %logger %level %class(%line) %ex %message%newline'
                    )
                ),
                'filters' => [
                    [
                        'class' => 'LoggerFilterLevelRange',
                        'params' => [
                            'levelMax' => 'debug',
                            'acceptOnMatch' => true,
                        ]
                    ]
                ],
                'params' => array(
                    'threshold' => 'debug',
                    'file' => 'logs/debug/' . date('Y-m') . '/' . date('Y-m-d') . '/debug_%s.log',
                    'datePattern' => 'Y-m-d.H'
                )
            ),
            'warn' => array(
                'class' => 'LoggerAppenderDailyFile',
                'layout' => array(
                    'class' => 'LoggerLayoutPattern',
                    'params' => array(
                        'conversionPattern' => '%date{Y-m-d H:i:s.u} %logger %level %class(%line) %ex %message%newline'
                    )
                ),
                'filters' => [
                    [
                        'class' => 'LoggerFilterLevelRange',
                        'params' => [
                            'levelMin' => 'warn',
                            'levelMax' => 'warn',
                            'acceptOnMatch' => true,
                        ]
                    ]
                ],
                'params' => array(
                    'threshold' => 'warn',
                    'file' => 'logs/warn/' . date('Y-m') . '/' . date('Y-m-d') . '/warn_%s.log',
                    'datePattern' => 'Y-m-d.H'
                )
            ),
            'error' => array(
                'class' => 'LoggerAppenderDailyFile',
                'layout' => array(
                    'class' => 'LoggerLayoutPattern',
                    'params' => array(
                        'conversionPattern' => '%date{Y-m-d H:i:s.u} %logger %level %class(%line) %ex %message%newline'
                    )
                ),
                'filters' => [
                    [
                        'class' => 'LoggerFilterLevelRange',
                        'params' => [
                            'levelMin' => 'error',
                            'levelMax' => 'error',
                            'acceptOnMatch' => true,
                        ]
                    ]
                ],
                'params' => array(
                    'threshold' => 'error',
                    'file' => 'logs/error/' . date('Y-m') . '/' . date('Y-m-d') . '/error_%s.log',
                    'datePattern' => 'Y-m-d.H'
                )
            ),
        ),
        'loggers' => array(
            'default' => [
                'level' => 'debug',
                'appenders' => ['debug', 'default', 'warn', 'error'],
                'additivity' => false,
            ],
        ),
    ),
);